package com.first.service.Impl;

import com.first.entity.CourseEntity;
import com.first.mapper.CourseMapper;
import com.first.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseMapper courseMapper;

    @Override
    public List<CourseEntity> getCourseList() {
        List <CourseEntity> courseList = courseMapper.getCourseList();
        return courseList;
    }

    @Override
    public void insertCourse(String courseTime, Integer courseNumber, Integer courseHour) {
        courseMapper.insertCourse(courseTime,courseNumber,courseHour);
    }

    @Override
    public int deleteCourse(Integer id) {
        int i = courseMapper.deleteCourse(id);
        return i;
    }

    @Override
    public void updateCourseTime(String courseTime, Integer courseNumber, Integer courseHour, Integer id) {
        courseMapper.updateCourseTime(courseTime,courseNumber,courseHour,id);
    }
}
